//
//  MyNotificationView.m
//  xpkc
//
//  Created by TopSageOSX on 14-8-22.
//  Copyright (c) 2014年 wanmeizty. All rights reserved.
//

#import "MyNotificationView.h"

@implementation MyNotificationView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [self creatView];
    }
    return self;
}

-(void)creatView{
    //创建
    self.title = [[UILabel alloc]init];
    self.time = [[UILabel alloc]init];
    self.webView = [[UIWebView alloc]init];
    UILabel *lineLabel = [[UILabel alloc]init];
    //位置
    CGRect title_frame;
    CGRect time_frame;
    CGRect web_frame;
    CGRect line_frame;
    if (isPad) {
        title_frame = RECT(0, 0, SCREEN_WIDTH, 50);
        time_frame = RECT(0, 50, SCREEN_WIDTH, 20);
        web_frame = RECT(0, 70, SCREEN_WIDTH, SCREEN_HEIGHT-70-64);
        line_frame = RECT(0, 77, SCREEN_WIDTH, 1);
    }else{
        title_frame = RECT(0, 0, SCREEN_WIDTH, 40);
        time_frame = RECT(0, 40, SCREEN_WIDTH, 30);
        web_frame = RECT(0, 70, SCREEN_WIDTH, SCREEN_HEIGHT-50-64);
        line_frame = RECT(0, 67, SCREEN_WIDTH, 1);
    }
    self.title.frame = title_frame;
    self.time.frame = time_frame;
    self.webView.frame = web_frame;
    lineLabel.frame = line_frame;
    //详细
    self.title.backgroundColor = [UIColor whiteColor];
    self.title.numberOfLines = 0;
    self.title.font = FONT_BOLD_BIG;
    self.time.backgroundColor = [UIColor whiteColor];
    self.webView.backgroundColor = [UIColor whiteColor];
    self.time.textColor = [UIColor lightGrayColor];
    self.time.font = FONT_SYS_S;
    lineLabel.backgroundColor = [UIColor lightGrayColor];
    //添加
    [self addSubview:self.title];
    [self addSubview:self.time];
    [self addSubview:self.webView];
    [self addSubview:lineLabel];
}
@end
